package com.develop.mybluetooth;

import android.app.Application;

import com.develop.bluetoothlib.MyBluetooth;
import com.develop.mybluetooth.activity.ErrorActivity;

import cat.ereza.customactivityoncrash.config.CaocConfig;


public class MyApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //初始化 Bluetooth
        MyBluetooth.init(this);
        MyBluetooth.getInstance()
                .setConnectTimeOut(10000);

        CaocConfig.Builder.create()
                .backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
//                .enabled(BuildConfig.DEBUG) //default: true
                .showErrorDetails(true) //default: true
                .showRestartButton(false) //default: true
                .logErrorOnRestart(false) //default: true
                .trackActivities(true) //default: false
                .minTimeBetweenCrashesMs(2000) //default: 3000
                .restartActivity(MainActivity.class) //default: null (your app's launch activity)
                .errorActivity(ErrorActivity.class)
                .apply();//default: null (default error activity)
    }
}
